package com.tulingxueyuan.order.config;


import com.tulingxueyuan.order.interceptor.feign.FeignAuthRequestInterceptor;
import feign.Logger;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 全局配置：当我们使用了@Configuration，会将配置作用所有的服务提供方
 * 局部配置：如果只想针对一个服务进行配置，就不要加@Configuration
 */
@Configuration
public class FeignConfig {

    @Bean
    public Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }

    /**
     * 自定义拦截器--配置类
     */
    @Bean
    public FeignAuthRequestInterceptor feignAuthRequestInterceptor() {
        return new FeignAuthRequestInterceptor();
    }
}
